package com.tiancheng.trade.settlement.enums;

import lombok.AllArgsConstructor;
import lombok.Getter;

import java.util.Arrays;
import java.util.Optional;

/**
 *对账函类型
 * @author 李凯伦
 * @date 2024/5/25
 */
@Getter
@AllArgsConstructor
public enum LettersTypeEnum {
    NORMAL(0, "正常对账单"),
    MANUAL_ADJUST(1, "手动调整单"),
    SYSTEM_ADJUST(2, "系统调整单");


    private Integer code;
    private String desc;

    public static String getDesc(Integer code) {
        Optional<LettersTypeEnum> found = Arrays.stream(LettersTypeEnum.values()).filter(c -> c.code.equals(code)).findFirst();
        if (found.isPresent()) {
            return found.get().getDesc();
        }
        return "";
    }


}
